package com.taptech.doufu.ui.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.taptech.doufu.R;
import com.taptech.doufu.constant.Constant;
import com.taptech.doufu.ui.activity.base.DiaobaoBaseActivity;
import com.taptech.doufu.ui.fragment.RankFragment;

import androidx.fragment.app.FragmentTransaction;

/**
 * author zhangyongcun
 * 16/11/16
 * 小说新版排行页面
 */

public class NovelRankActivity extends DiaobaoBaseActivity  {

    public static final String SEX_TYPE = "sex_type";

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_novel_rank);
        String sexType = getIntent().getStringExtra(SEX_TYPE);
        FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
        ft.add(R.id.layContent, RankFragment.newInstance("http://api.doufu.la/entrance_item/rank_list?version=2&sexType="+sexType, true));
        ft.commit();
    }


    public void onHelpClick(View view) {
        Intent intent = new Intent();
        intent.setClass(NovelRankActivity.this, BrowseActivity.class);
        intent.putExtra(Constant.URL, Constant.HOST_NAME_SECOND + "/journal/detail?id=799");
        startActivity(intent);
    }

    public void onBack(View view) {
        finish();
    }

}
